package com.lanou3g.srpingjpa1.repository;

import com.lanou3g.srpingjpa1.entity.RoleInfo;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.repository.query.Param;
import org.springframework.data.rest.core.annotation.RepositoryRestResource;
import org.springframework.data.rest.core.annotation.RestResource;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

/**
 * 创建 JYQ  on  2018/10/31,10:19
 */
@RepositoryRestResource(path = "roleList")
public interface RoleInfoRepository extends JpaRepository<RoleInfo,Long> {

    @RestResource(path = "findByName")
//    param注解的参数是   网址上的参数
//     这个方法 返回集合 like '%name%'
//    http://localhost:8080/api/roleList/search/
    List<RoleInfo>  findByNameContains(@Param("name") String  name);


//    @RequestMapping("findByIdBetween")
//    List<RoleInfo>   findByRoleIdBetweenAndRoleId(@Param("start") Long start,@Param("end") Long end);



}
